5.13 Miscellaneous
5.13.1 Some useful functions
void complete_graph( graph& G, int n) & &creates a complete graph G with n nodes. void random_graph( graph& G, int n, int m) &creates a random graph G with n nodes &and m edges. void test_graph( graph& G) &creates interactively a user defined graph G. void test_bigraph( graph& G, nodelist& A, nodelist& B) &creates interactively a user defined bipartite &graph G with sides A and B. All edges are &directed from A to B. bool compute_correspondence( graph& G, edge(edge)& reversal) &computes for every edge e = (v, w) in G its &reversal reversal[e] = (w, v) in G ( nil if ¬ present). Returns true if every edge has a &reversal and false otherwise. void eliminate_parallel_edges( graph& G) &removes all parallel edges from G. void cmdline_graph( graph& G, int argc, char** argv) &builds graph G as specified by the command line &arguments: &prog & → test_graph() &prog n & → complete_graph(n) &prog n m & → test_graph(n, m) &prog file & → G.read_graph(file)